import React,{Component} from 'react';
import PropTypes from 'prop-types';
import Icon from '../Icon';
import './Button.css';

class Button extends Component {
    static propTypes = {
        iconType : PropTypes.string,
        value : PropTypes.string,
        size : PropTypes.string,
        type : PropTypes.string,
        onClick : PropTypes.func
    }
    // constructor(props) {
    //     super(props);
    // }
    
    render() {
        const size = this.props.size ? this.props.size : 'btn-md';
        const type = this.props.type ? this.props.type : '';
        return (
            <a onClick={this.props.onClick} className={`p_button button-${type} ${size}`}>
                {this.props.iconType ? <Icon type={this.props.iconType} /> : ''}
                
                {
                    this.props.children ? 
                    <span>{this.props.children}</span>
                    : ''
                }
            </a>
        )
    }
} 
export default Button